<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('教师评阅')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-role-edit" th:object="${workly}">
			<input id="worklyId" name="worklyId" type="hidden" th:field="*{worklyId}"/>
			<input id="worklyCategory" name="worklyCategory" type="hidden" th:field="*{worklyCategory}"/>
			<input id="stuProdId" name="stuProdId" type="hidden" th:field="*{stuProdId}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label ">周报内容：</label>
				<div class="col-sm-8">
					<textarea class="form-control" type="text" name="worklyMain" id="worklyMain" th:field="*{worklyMain}"
							  style="margin: 0px 12px 0px 0px; width: 461px; height: 344px;" readonly/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">分数：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="worklyScore" id="worklyScore" th:field="*{worklyScore}" readonly/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">实际得分：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="worklyActScore" id="worklyActScore" th:field="*{worklyActScore}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label ">教师评语：</label>
				<div class="col-sm-8">
					<textarea class="form-control" type="text" name="worklyRemark" id="worklyRemark" th:field="*{worklyRemark}"
							  style="margin: 0px 12px 0px 0px; width: 461px; height: 144px;"/>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<th:block th:include="include :: datetimepicker-js" />
	<script type="text/javascript">
	     $(function() {

		});

		function edit() {
			var worklyId = $("input[name='worklyId']").val();
			var worklyScore = $("input[name='worklyScore']").val();
			var worklyActScore = $("input[name='worklyActScore']").val();
			var worklyRemark = $("textarea[name='worklyRemark']").val();
			var worklyCategory = $("input[name='worklyCategory']").val();
			var stuProdId = $("input[name='stuProdId']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "sau/teaaudit/updateWeeklyByTea",
				data : {
					"worklyId": worklyId,
					"worklyScore" : worklyScore,
					"worklyActScore": worklyActScore,
					"worklyRemark": worklyRemark,
					"worklyCategory" : worklyCategory,
					"stuProdId" : stuProdId
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	edit();
	        }
	    }
	</script>
</body>
</html>
